import{d as I,l as x,o as u,c as M,e as g,q as o,K as A,a6 as B,f as c,m as K,r as S,t as m,_ as D,S as E,C as r,M as P,a7 as w,b as _,a3 as N,w as l,Z as V,J as Z,a2 as j,H,a8 as J,a9 as U}from"./index-c80Lh_is.js";const W=["href"],F=I({__name:"DocumentationLink",props:{href:{}},setup(f){const{t:p}=x(),h=f;return(e,v)=>(u(),M("a",{class:"docs-link",href:h.href,target:"_blank"},[g(o(B),{size:o(A),title:o(p)("common.documentation")},null,8,["size","title"]),c(),K("span",null,[S(e.$slots,"default",{},()=>[c(m(o(p)("common.documentation")),1)],!0)])],8,W))}}),G=D(F,[["__scopeId","data-v-1e7645ce"]]),Q={key:0,class:"app-collection-toolbar"},z=5,X=I({__name:"AppCollection",props:{isSelectedRow:{type:[Function,null],default:null},total:{default:0},pageNumber:{default:1},pageSize:{default:30},items:{},headers:{},error:{default:void 0},emptyStateTitle:{default:void 0},emptyStateMessage:{default:void 0},emptyStateCtaTo:{default:void 0},emptyStateCtaText:{default:void 0}},emits:["change"],setup(f,{emit:p}){const{t:h}=x(),e=f,v=p,L=E(),k=r(e.items),C=r(0),b=r(0),y=r(e.pageNumber),T=r(e.pageSize),O=P(()=>{const t=e.headers.filter(a=>["details","warnings","actions"].includes(a.key));if(t.length>4)return"initial";const s=100-t.length*z,n=e.headers.length-t.length;return`calc(${s}% / ${n})`});w(()=>e.items,(t,s)=>{t!==s&&(C.value++,k.value=e.items)}),w(()=>e.pageNumber,function(){e.pageNumber!==y.value&&b.value++});function R(t){if(!t)return{};const s={};return e.isSelectedRow!==null&&e.isSelectedRow(t)&&(s.class="is-selected"),s}const q=t=>{const s=t.target.closest("tr");if(s){const n=s.querySelector("a");n!==null&&n.click()}};return(t,s)=>{var n;return u(),_(o(U),{key:b.value,class:"app-collection",style:J(`--column-width: ${O.value}; --special-column-width: ${z}%;`),"has-error":typeof e.error<"u","pagination-total-items":e.total,"initial-fetcher-params":{page:e.pageNumber,pageSize:e.pageSize},headers:e.headers,"fetcher-cache-key":String(C.value),fetcher:({page:a,pageSize:i,query:$})=>{const d={};return y.value!==a&&(d.page=a),T.value!==i&&(d.size=i),y.value=a,T.value=i,Object.keys(d).length>0&&v("change",d),{data:k.value}},"cell-attrs":({headerKey:a})=>({class:`${a}-column`}),"row-attrs":R,"disable-sorting":"","hide-pagination-when-optional":"","onRow:click":q},N({_:2},[((n=e.items)==null?void 0:n.length)===0?{name:"empty-state",fn:l(()=>[g(j,null,N({default:l(()=>[c(m(e.emptyStateTitle??o(h)("common.emptyState.title"))+" ",1),c()]),_:2},[e.emptyStateMessage?{name:"message",fn:l(()=>[c(m(e.emptyStateMessage),1)]),key:"0"}:void 0,e.emptyStateCtaTo?{name:"cta",fn:l(()=>[typeof e.emptyStateCtaTo=="string"?(u(),_(G,{key:0,href:e.emptyStateCtaTo},{default:l(()=>[c(m(e.emptyStateCtaText),1)]),_:1},8,["href"])):(u(),_(o(V),{key:1,appearance:"primary",to:e.emptyStateCtaTo},{default:l(()=>[g(o(Z),{size:o(A)},null,8,["size"]),c(" "+m(e.emptyStateCtaText),1)]),_:1},8,["to"]))]),key:"1"}:void 0]),1024)]),key:"0"}:void 0,H(Object.keys(o(L)),a=>({name:a,fn:l(({row:i,rowValue:$})=>[a==="toolbar"?(u(),M("div",Q,[S(t.$slots,"toolbar",{},void 0,!0)])):S(t.$slots,a,{key:1,row:i,rowValue:$},void 0,!0)])}))]),1032,["style","has-error","pagination-total-items","initial-fetcher-params","headers","fetcher-cache-key","fetcher","cell-attrs"])}}}),ee=D(X,[["__scopeId","data-v-06f2a961"]]);export{ee as A,G as D};
